<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('virtuals', function (Blueprint $table) {
            $table->id();
            $table->integer('category_id')->comment('年级id');
            $table->integer('unit_id')->comment('单元id');
            $table->string('unit_name')->nullable()->comment('定制单元名称');
            $table->string('unit_main_name')->nullable()->comment('单元主名称');
            $table->string('page_number')->nullable()->comment('页码');
            $table->string('title')->nullable()->comment('书页标题');
            $table->string('image')->nullable()->comment('封面图');
            $table->string('mobile_image')->nullable()->comment('竖版封面');
            $table->string('video')->nullable()->comment('封面图');
            $table->tinyInteger('is_read')->default(0)->comment('是否跟读');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('virtuals');
    }
};
